<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
    <style>
    .active1{
        color:red;
    }
    .active2{
        color:blue;
    }
    </style>
</head>
<body>
    <div id='app'>
        {{msg}}

        <!-- <div :class="{active1:flag,active2:flag2}">这时class</div> -->
        <div :class="['red',flag2?red2:'',{red3:flag}]" >这是第二种class</div>
        <div :style="obj" >这是第3种class</div>
        <div :style="{color:cr}" >这是第4种class</div>
        <div :style="arrC" >这是第5种class</div>
        <div :style="[obj,{color:yl,fontSize:'100px'}]" >这是第6种class</div>


        <input type="button" value="btnClass" @click='changeColor'>
    </div>
    <script type='text/javascript'>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                flag:true,
                flag2:false,
                red2:'r2',
                obj:{
                    height:"200px",
                    color:"green"
                },
                cr:'red',
                arrC:[
                    {color:"purple"}
                ],
                yl:'yellow'

            },
            methods:{
                changeColor(){
                    this.flag = !this.flag
                    this.flag2 = !this.flag2
                }
            }
        });
    </script>
</body>
</html>